<extend name="Index:base" />
<block name="title"><title>商品管理</title></block>
<block name="style">
 <style>
.main,.panel-default>.panel-heading{
background:none;
}
body{
background:none;
}
.panel.panel-default,.panel .panel-body,.panel .panel-heading,.table-bordered {
	border:none;
}
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
	border:none;		
	padding:15px;	
	line-height:8px;
	height: 8px;
	border-top: 1px solid #d4d4d4;
	border-bottom: 1px solid #d4d4d4;
}
.name strong{
color:#000000;
font-size:15px;
font-weight:600;
}
.name {
	color:#20a8d8;
	font-size:12px;
}
.smallfont {
	color:#9c9c9c;
	font-size:12px;
}

.align-center{
	text-align:center; 
}
.title2{
text-align:center;
}
.table-bordered > tbody > tr .wd{
	text-align:left;	
}

.col-xs-2,.col-xs-4{
padding-right:0;
margin:10px 0;
}
.col-sm-3{
width:10%;
}
.col-sm-2{
width:8%;
}
.col-sm-1{
width:5%;
}
.col-sm-4{
width:18%;
}
.col-sm-1,.col-sm-2{
margin:16px 0;
}
.col-sm-3,.col-sm-4{
margin:10px 0;
}
.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4{
padding-right:0;
}
 </style>
</block>
	<!-- start: Header -->
<block name="body">

			<!-- end: Main Menu -->
						
		<!-- start: Content -->
		<div class="main ">
		
			<div class="row">
				<div class="col-lg-12">
					<h3 class="page-header"><i class="fa fa-life-bouy"></i>商品管理</h3>
				</div>
			</div>

			<div class="row">		
				<div class="col-lg-12">
					<div class="panel panel-default">
						<div class="panel-heading">
							&nbsp;&nbsp;&nbsp;<a class="btn btn-default" href="{:U('Goods/goods_list')}" >所有商品</i></a>

							&nbsp;&nbsp;&nbsp;
							<a class="btn btn-primary" href="{:U('Goods/goods_list')}?clear=2" >强制刷新</i></a>
							
							<h2><span class="break"></span><strong>违规下架商品</strong></h2>							
							&nbsp;&nbsp;&nbsp;<a class="btn btn-default" href="" >等待审核</i></a>							
							&nbsp;&nbsp;&nbsp;<a class="btn btn-default" href="" >商品设置</i></a>
						</div>
						<ol class="breadcrumb" style="height:35px;background-color: #ffffff;">							
							<li><i class="fa fa-warning"></i><a href="#">操作提示：</a></li><br/>	
							<li><font style="font-size:8px;color:#888;"></font></li>							
						</ol>
						<div class="panel-body">
							<!--搜索 开始-->
							<form method="get" name="formSearch" id="formSearch">
							
				               <div class="col-md-12" style="background-color:#f5f5f5;padding:0;">
								<div class="form-group" style="width:100%;">
				                    
									<label class="col-sm-2 control-label" for="input-small">商品名称</label>
									<div class="col-sm-4">
										<input type="text" id="member_name" name="member_name" class="form-control" placeholder="">
				                    </div>
				                    
									<label class="col-sm-1 control-label" for="input-small">分类</label>
									<div class="col-sm-3">
											<select name="store_type" class="form-control">
												<option value="">请选择...</option>
                                                <option value="open">开启</option>
												<option value="close">关闭</option>
												<option value="expire">即将到期</option>
												<option value="expired">已到期</option>
                                            </select>
				                    </div>
				                   
				                    </div>
				                </div>
				               </div>
				               <div class="col-md-12" style="background-color:#f5f5f5;padding:0;">
								<div class="form-group" style="width:100%;">
				                    
									<label class="col-sm-2 control-label" for="input-small">所属店铺</label>
									<div class="col-sm-4">
										<input type="text" id="member_name" name="member_name" class="form-control" placeholder="">
				                    </div>
				                    
									<label class="col-sm-2 control-label" for="input-small">品牌</label>
									<div class="col-sm-4">
				                        <input type="text" id="member_name" name="member_name" class="form-control" placeholder="">
				                    </div>

				                    <div class="col-sm-3">
										<button type="submit" class="btn btn-primary">搜索</button>
				                    </div>
				                </div>
				               </div>				                    
							  </form>
							  <!--搜索 结束-->
							<table class="table table-striped table-bordered bootstrap-datatable datatable">
							  <thead>
								  <tr>
								  
									  <th>平台货号</th>
                                      <th>商品名称</th>
									  <th>&nbsp;</th>
									  <th class="title2">品牌&分类</th>
									  <th class="title2">价格(元)</th>
									  <th class="title2">库存</th>
									  <th class="title2">商品状态</th>
									  <th class="title2">操作</th>
								  </tr>
							  </thead>   
							  <tbody id="state">
								<foreach name="list" item="vo">
								<tr>
									<td>{$vo.number}</td>
									<td class="wd">
									<img src="{$vo.pic}" onload="javascript:DrawImage(this,56,56);" width="56" height="48">
									</td>
									<td class="wd">
										<p class="name" ><strong>{$vo.productname}</strong></p>
										<p class="smallfont"><in name="vo.is_own_shop" value="1">平台店铺：</in><in name="vo.is_own_shop" value="0">三方店铺：</in>{$vo.store_name}&nbsp;</p>
									</td>
									 <td class="align-center">
										<p class="smallfont">
										{$vo.gc_name}&nbsp;
										</p>
										<p class="smallfont">
										品牌：&nbsp;
										</p>									 
									 </td>
									 <td class="align-center" style="color:red;">{$vo.price}</td>
									 <td class="align-center">{$vo.goods_storage}</td>
									<td class="align-center">
									<if condition="$vo.goods_state eq '0'">仓库中</if>
									<if condition="$vo.goods_state eq '1'">出售中</if>
									<if condition="$vo.goods_state eq '10'">违规下架</if>
									</td>
									<td class="align-center">
										<in name="vo.goods_verify" value="10">
										<a class="label label-primary"  href="" >查看</i>
										</a>
										</in>
										<a href="#" data-id="{$vo.id}" data-type="del">			
										&nbsp;
										<in name="vo.goods_verify" value="10">
										<span class="label label-danger" data-status="1"  >删除</span>
										</in>									
										</a>
																			
									 </td>

								</tr>
								</foreach>
							  </tbody>
						  </table>  
							<ul class="pagination">
								{$page}
							 </ul>						  
						</div>
					</div>
				</div><!--/col-->
			
			</div><!--/row-->				
			
		<!-- end: Content -->
		<br><br><br>
		
	</div><!--/container-->
	
</block>
<block name="script">
<script>

$(".align-center a").click(function(){

    var id = $(this).attr('data-id');
	var state = $(this).find('span').attr('data-status');
	
	var type = $(this).attr('data-type');
	//alert(id);	
	if (id && state && type=="del") {
		if(confirm("确定要删除吗？")){
			//是
			$.ajax({
				url:"{:U('Goods/goods_del')}",
				data:{id:id,str:'id',table:1},
				type:'post',
				dataType:'json',
				success:function (e) {			
				
					alert(e.info);
					location.reload();				
				}
			});													
		}else{
			//否
			return false;
		}		
	}  

});
</script>
</block>	









